﻿<controls:ChildWindow x:Class="TimeSheet.UI.ProjectsWindow"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           xmlns:tkwin   ="clr-namespace:System.Windows;assembly=System.Windows.Controls"
           xmlns:my="clr-namespace:Dev.Silverlight.Controls;assembly=Dev.Silverlight"
           Width="627" Height="412"                      
           Title="Projects" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk">
    <Grid x:Name="LayoutRoot" Margin="2">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <!-- Toolbar -->
        <my:ToolbarGroup Height="32" VerticalAlignment="Top">
            <StackPanel Orientation="Horizontal">

                
                
                <!-- Add new category button-->
                <my:ToolbarToggleButton Width="32" Margin="2" ToolTipService.ToolTip="Add a new category" Name="btnAddCategory" Click="btnAddCategory_Click">
                    <Image Source="Images/AddFolder.png" Width="16" Height="16" />
                </my:ToolbarToggleButton>

                <!-- Add new project button-->
                <my:ToolbarDropDownButton Width="32" Margin="2" ToolTipService.ToolTip="Add a new project reference" Name="btnAddProject" Click="btnAddProject_Click">
                    <Image Source="Images/Add.png" Width="16" Height="16"/>                    
                </my:ToolbarDropDownButton>

                <!-- Delete button -->
                <my:ToolbarButton Width="32" Margin="2" ToolTipService.ToolTip="Delete the selected project" Name="btnDelete" Click="btnDelete_Click">
                    <Image Source="Images/Delete.png" Width="16" Height="16" />
                </my:ToolbarButton>

                <!-- Move Up button-->
                <my:ToolbarButton Width="32" Margin="2" ToolTipService.ToolTip="Move this item to up" Name="btnMoveUp" Click="btnMoveUp_Click">
                    <Image Source="Images/ArrowUp.png" Width="16" Height="16" />
                </my:ToolbarButton>

                <!-- Move Down button-->
                <my:ToolbarButton Width="32" Margin="2" ToolTipService.ToolTip="Move this item to bottom" Name="btnMoveDown" Click="btnMoveDown_Click">
                    <Image Source="Images/ArrowBottom.png" Width="16" Height="16" />
                </my:ToolbarButton>



            </StackPanel>
        </my:ToolbarGroup>        
        
        <!-- Treeview -->
        <controls:TreeView HorizontalAlignment="Left" Margin="0,48,0,0" Name="tvwProject" Width="176" ItemsSource="{Binding Path=Categories, Mode=TwoWay}">
            <controls:TreeView.ItemTemplate>
                <tkwin:HierarchicalDataTemplate ItemsSource="{Binding Path=Projects, Mode=TwoWay}">
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding Name}"/>
                    </StackPanel>
                </tkwin:HierarchicalDataTemplate>
            </controls:TreeView.ItemTemplate>
        </controls:TreeView>
        
        <!-- Content panel -->
        <Grid Margin="177,48,7,0" Name="panDetail">
            <sdk:Label Content="Name :" Margin="10,10,0,0" Name="lblName" VerticalAlignment="Top" HorizontalAlignment="Left" />
            <TextBox Height="22" Margin="10,32,7,0" Name="txtName" VerticalAlignment="Top" Text="{Binding Path=Name, Mode=TwoWay}" />
            <sdk:Label Content="Reference :" Margin="10,73,0,0" Name="lblReference" VerticalAlignment="Top" HorizontalAlignment="Left" />
            <TextBox Height="22" Margin="10,95,7,0" Name="txtReference" VerticalAlignment="Top" Text="{Binding Path=Reference, Mode=TwoWay}" />            
        </Grid>

        <!-- Close buttons -->
        <Button x:Name="btnOK" Content="OK" Click="btnOK_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,79,0" Grid.Row="1" />
        <Button x:Name="btnCancel" Content="Cancel" Click="btnCancel_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,0,0" Grid.Row="1" />        

    </Grid>
</controls:ChildWindow>